<?php
html::printPath(array(
		'seminar.form-title' => 'admin/seminar/all',
		$seminar['name'] => '/admin/seminar/display?id=' . $seminar['id'],
		'seminarTranslation.form-title' => '/admin/seminarTranslation/listing?seminar_id=' . $seminar['id'],
		'application.page-title-' . (sql::isPersistent($formData) ? 'edit' : 'insert') => ''
)
);
$msg->printMessages();

$fb = new FormBuilder('seminar', $formData);
$fb->hidden('seminar_id');
$fb->doNotCloseForm();
$fb->comboBox('language_code', $languageOptions)->labelKey('common.language')->required();
$fb->text('name')->appendix($formData['name_local'])->required();
$fb->textarea('description')->appendix($formData['description_local'])->required();
$fb->write();

echo '<h3>' . text::getEscaped('seminarTranslation.seminarBatchNames') . '</h3>';

$fb = new FormBuilder('seminar', $formData);
$fb->doNotOpenForm();
foreach ($batchTypeList as $batchType) {
	$fb->delimiter($batchType['name']);
	foreach ($batchType['batchList'] as $batch) {
		$fb->text('batch_' . $batch['batch_code'])->label(format::dateInterval($batch['begin_date'], $batch['end_date']))->appendix($batch['name_local'])->required();
	}
}

$fb->submitButton();
$fb->write();
